<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>
    <div>
    	<h3>属性</h3>
    	<p>国际移动设备身份码(imei): <span id="imei"></span></p>
    	<p>国际移动用户识别码(imsi): <span id="imsi"></span></p>
    	<p>設備的型號(imsi): <span id="model"></span></p>
    	<p>設備的廠商(vendor): <span id="vendor"></span></p>
    	<p>设备的唯一标识(uuid): <span id="uuid"></span></p>
    </div>
    <div>
    	<h3>方法</h3>
    	<p onclick="dail()">拨打电话(dial)</p>
    	<p onclick="beep()">发出蜂鸣声(beep)</p>
    	<p onclick="vibrate()">设备震动(vibrate)</p>
    	<p onclick="setWakelock()">设置屏幕常亮(setWakelock)</p>
    	<p onclick="isWakelock()">获取屏幕常亮状态(isWakelock)</p>
    	<p onclick="setVolume()">设置音量(setVolume)</p>
    	<p onclick="getVolume()">获取音量(getVolume)</p>
    </div>
    <div>
    	<h3>屏幕对象信息</h3>
    	<p>逻辑屏幕高度分辨率(resolutionHeight): <span id="resolutionHeight"></span></p>
    	<p>逻辑屏幕宽度分辨率(resolutionWidth): <span id="resolutionWidth"></span></p>
    	<p>逻辑分辨率与实际分辨率的比例(scale): <span id="scale"></span></p>
    	<p>设备屏幕水平方向的密度(dpiX): <span id="dpiX"></span></p>
    	<p>设备屏幕垂直方向的密度(dpiY): <span id="dpiY"></span></p>
    	<p onclick="setBrightness()">设置屏幕亮度(setBrightness)</p>
    	<p onclick="getBrightness()">获取屏幕亮度(getBrightness)</p>
    	<p onclick="lockOrientation()">锁定屏幕方向(lockOrientation)</p>
    	<p onclick="unlockOrientation()">解除锁定屏幕方向(unlockOrientation)</p>
    </div>
    <div>
    	<h3>display对象</h3>
    	<p>可使用屏幕高度分辨率(resolutionHeight): <span id="apllyHeight"></span></p>
    	<p>可使用屏幕宽度分辨率(resolutionWidth): <span id="apllyWidth"></span></p>
    </div>
    <div>
    	<h3>网络常量</h3>
    	<p>当前设备网络连接状态(getCurrentType): <span id="getCurrentType"></span></p>
    	<p>0: plus.networkinfo.CONNECTION_UNKNOW 未知</p>
    	<p>1: ...CONNECTION_NONE 未连接网络</p>
    	<p>2: ...CONNECTION_ETHERNET 有线网络</p>
    	<p>3: ...CONNECTION_WIFI wifi</p>
    	<p>4: ...CONNECTION_CELL2G 2G移动网络</p>
    	<p>5: ...CONNECTION_CELL3G 3G移动网络</p>
    	<p>6: ...CONNECTION_CELL4G 4G移动网络</p>
    </div>
    <div>
    	<h3>OS系统相关</h3>
    	<p>系统语言(language): <span id="language"></span></p>
    	<p>系统版本(version): <span id="version"></span></p>
    	<p>系统名称(name): <span id="name"></span></p>
    	<p>系统的供应商(vendor): <span id="syVendor"></span></p>
    </div>
    <script type="text/javascript">
    	var imei = document.getElementById('imei');
    	var imsi = document.getElementById('imsi');
    	var model = document.getElementById('model');
    	var vendor = document.getElementById('vendor');
    	var uuid = document.getElementById('uuid');
    	var scale = document.getElementById('scale');
    	var dpiX = document.getElementById('dpiX');
    	var dpiY = document.getElementById('dpiY');
    	var resolutionHeight = document.getElementById('resolutionHeight');
    	var resolutionWidth = document.getElementById('resolutionWidth');
    	var apllyHeight = document.getElementById('apllyHeight');
    	var apllyWidth = document.getElementById('apllyWidth');
    	var getCurrentType = document.getElementById('getCurrentType');
    	var language = document.getElementById('language');
    	var version = document.getElementById('version');
    	var osName = document.getElementById('name');
    	var syVendor = document.getElementById('syVendor');
    	
    	
    	
    	// 属性
		function plusReady(){
			imei.innerText = plus.device.imei;
			imsi.innerText = plus.device.imsi;
			model.innerText = plus.device.model;
			vendor.innerText = plus.device.vendor;
			uuid.innerText = plus.device.uuid;
			// 屏幕相关
			resolutionHeight.innerText = plus.screen.resolutionHeight;
			resolutionWidth.innerText = plus.screen.resolutionWidth;
			scale.innerText = plus.screen.scale;
			dpiX.innerText = plus.screen.dpiX;
			dpiY.innerText = plus.screen.dpiY;
			apllyHeight.innerText = plus.display.resolutionHeight;
			apllyWidth.innerText = plus.display.resolutionWidth;
			getCurrentType.innerText = plus.networkinfo.getCurrentType();
			language.innerText = plus.os.language;
			version.innerText = plus.os.version;
			osName.innerText = plus.os.name;
			syVendor.innerText = plus.os.vendor;
		}
		if(window.plus){
			plusReady();
		}else{
			document.addEventListener("plusready",plusReady,false);
		}
		
		// 方法
		function dail(){
			plus.device.dial( "10010", true );  //第二個參數是是否要用戶確認
		}
		function beep() {
			plus.device.beep(3);  // 參數為时间
		}
		function vibrate() {
			plus.device.vibrate(500);  // 参数为时间，毫秒
		} 
		function setWakelock() {
			plus.device.setWakelock(true);  //true为常亮，false为不常亮
		}
		function isWakelock() {
			alert(plus.device.isWakelock());
		}
		function setVolume() {
			plus.device.setVolume(0);  // 从0到1，从小到大
		}
		function getVolume() {
			plus.device.getVolume();  //范围从0到1
			alert(plus.device.getVolume());
		}
		function setBrightness() {
			plus.screen.setBrightness( 0.5 );
		}
		function getBrightness() {
			alert(plus.screen.getBrightness());
		}
		function lockOrientation() {
			void plus.screen.lockOrientation( 'landscape-primary' );
		}
		function unlockOrientation() {
			void plus.screen.lockOrientation();
		}
    </script>
</head>
<body>
	
</body>
</html>